#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTcpServer>
#include <QTcpSocket>
#include "crypto.h"

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = nullptr);
    ~Widget();

private:
    QByteArray encrypt(const QByteArray &input); //加密
    QByteArray decrypt(const QByteArray &input); //解密

private:
    char *k1;
    char *k2;
    Crypto client;
    Ui::Widget *ui;
    QTcpServer *server;
    QTcpSocket *socket;
    QTcpSocket *newSocket;
};

#endif // WIDGET_H
